package com.secondary.service;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.secondary.dao.user.UserDao;
import com.secondary.pojos.User;
@Service
public class UserService {
	@Resource
	private UserDao userDao;
	public User saveUser(User user){
		return userDao.register(user);
	}
	public User login(String username,String pwd){
		return userDao.login(username, pwd);
	}
	public void updateUserLogInfo(User user,String ip){
		
		userDao.updateUserLogInfo(user, ip);
	}
	public String findUserPassWordById(int id){
		return userDao.findUserPassWordById(id);
	}
	public void updateUserPassWord(int id,String passWord){
		userDao.updateUserPassWord(id,passWord);
	}
	public void updateUserInfo(User user){
		userDao.updateUserInfo(user);
	}
	public void updateUserAvatar(User user){
		userDao.updateUserAvatar(user);
	}
	public boolean findUserAccount(String userAccount){
		return userDao.findUserAccount(userAccount);
	}
	public User findUserById(int id){
		return userDao.findUserBuId(id);
	}
	public UserDao getUserDao() {
		return userDao;
	}
	public void setUserDao(UserDao userDao) {
		this.userDao = userDao;
	}
	
	
	
}
